<div class="container">
  <ol class="breadcrumb">
    <li><%= link_to 'Home', root_path %></li>
    <li><%= link_to 'VMS', vms_path(@vms) %></li>
    <li class="active">Camera</li>
  </ol>
</div>

<div class="container">
  <%= render 'vms_connectors/info' %>
  <%= render 'vmses/info' %>
  <%= render 'info' %>

  <p>

  <h1>
    All registered Streams
    <a href="<%= new_vms_camera_stream_path(@vms, @camera, @stream) %>" class="btn btn-success">
      <span class="glyphicon glyphicon-plus"></span> Create new Stream</a>
  </h1>
  </p>


  <% if @camera.streams.empty? %>
      <div class="alert alert-warning">
        <center>
          Currently no Streams are registered for the Camera.
        </center>
      </div>
  <% else %>
      <div class="media">
        <table class="table table-hover">
          <thead>
          <tr>
            <th>Name</th>
            <th>Description</th>
            <th>Width</th>
            <th>Height</th>
            <th>Keep aspect ratio</th>
            <th>Allow upsizing</th>
            <th>Compression rate</th>
            <th colspan="3"></th>
          </tr>
          </thead>

          <tbody>
          <% @camera.streams.each do |stream| %>
              <tr>
                <td><%= stream.name %></td>
                <td><%= stream.description %></td>
                <td><%= stream.width %></td>
                <td><%= stream.height %></td>
                <td><%= stream.keep_aspect_ratio %></td>
                <td><%= stream.allow_upsizing %></td>
                <td><%= stream.compression_rate %></td>
                <td><%= link_to 'Show', vms_camera_stream_path(@vms, @camera, stream), :class => "btn btn-xs btn-default" %></td>
                <td><%= link_to 'Edit', edit_vms_camera_stream_path(@vms, @camera, stream), :class => "btn btn-xs btn-warning" %></td>
                <td><%= link_to 'Delete', vms_camera_stream_path(@vms, @camera, stream), method: :delete, :class => "btn btn-xs btn-danger", data: {confirm: 'Are you sure?'} %></td>
              </tr>
          <% end %>
          </tbody>
        </table>
      </div>
  <% end %>
</div>